﻿@{
    ViewBag.Title = "停车服务列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using AFT.Parking.Entity.Locations;
@using AFT.Parking.Foundation;
@using AFT.Parking.WebSite.Common

@model IPagedList<CarLocationsEx>
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>停车场列表</h3>

        <div class="clear"></div>
    </div>
    <form id="frm">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <table>
                    <thead>
                        <tr>
                            <th>用户ID</th>
                            <th>停车场</th>
                            <th>停车区</th>
                            <th>立柱区</th>
                            <th>状态</th>
                            <th>最近存车时间</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <td colspan="6">
                                <div class="pagination">
                                    @Html.Pager(Model)
                                </div>
                                <!-- End .pagination -->
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </tfoot>
                    <tbody id="tBodyRows">
                        @foreach (var item in Model.Rows)
                        {
                            <tr id="@("tr"+item.CarLocation.Id)">
                                <td>
                                    @item.CarLocation.UserId
                                </td>
                                <td>
                                    @if (item.Parking != null)
                                    {
                                        @(item.Parking.Name + "（" + (item.Parking.IsEnable ? "正常）" : "停用）"))
                                    }
                                </td>
                                <td>
                                    @if (item.ParkingArea != null)
{
    @(item.ParkingArea.Name + "（" + (item.ParkingArea.IsEnable ? "正常）" : "停用）"))
}
                                </td>
                                <td>
                                    @if (item.ParkingLocation != null)
                                    {
                                        @(item.ParkingLocation.Name + "（" + (item.ParkingLocation.IsEnable ? "正常）" : "停用）"))
                                    }
                                </td>
                                <td>@if (item.CarLocation.Status == 1)
                                    {
                                        @Html.Raw("存车")
                                    }
                                    else if (item.CarLocation.Status == 2)
                                    {
                                        @Html.Raw("取车")
                                    }
                                    else
                                    {
                                         @Html.Raw("无")
                                    }</td>
                                <td>@item.CarLocation.CreatedOn.ToString("yyyy-MM-dd HH:mm")</td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <!-- End #tab1 -->
        </div>
        <!-- End .content-box-content -->
    </form>
</div>